Si la secuencia aleatoria \(\{x_t\}\) tiene media \(E[x_t]=\mu_t\) la autocovarianza esta dada por: \[\begin{equation} \begin{matrix} cov[x_{t_1},x_{t_2}] & = & E[(x_{t_1}-\mu_{t_1})(x_{t_2}-\mu_{t_2})] \\ & = & E[(x_{t_1}x_{t_2})] - \mu_{t_1}\mu_{t_2} \end{matrix} \end{equation}\]
\[\begin{equation} \begin{matrix} E[(x_{t_1}-\mu_{t_1})(x_{t_2}-\mu_{t_2})] = E[(x_{t_1}x_{t_2} - x_{t_1}\mu_{t_2} - \mu_{t_1}x_{t_2} + \mu_{t_1}\mu_{t_2})] \\ = E[x_{t_1}x_{t_2}] - E[x_{t_1}\mu_{t_2}] - E[\mu_{t_1}x_{t_2}] + E[\mu_{t_1}\mu_{t_2}] \\ = E[x_{t_1}x_{t_2}] - E[x_{t_1}]\mu_{t_2} - \mu_{t_1}E[x_{t_2}] + \mu_{t_1}\mu_{t_2} \\ = E[x_{t_1}x_{t_2}] - \mu_{t_1}\mu_{t_2} - \mu_{t_1}\mu_{t_2} + \mu_{t_1}\mu_{t_2} \\ = E[x_{t_1}x_{t_2}] - \mu_{t_1}\mu_{t_2} \end{matrix} \end{equation}\]
La autocovarianza de orden \(j\) se define como;
\[\begin{equation} \gamma_j = cov(x_{t},x_{t-j}) = E[(x_{t}x_{t-j})] - \mu_{t}\mu_{t-j} \end{equation}\]
Ahora, definimos la auto-correlación como
\[\begin{equation} \rho_j = \frac{\gamma_j}{\gamma_0} \end{equation}\]
La ventaja de usar la auto-correlación en vez de la auto-covarianza es que la auto-correlación siempre va a estar entre -1 y 1, dado que la covarianza siempre es igual o menor en valor absoluto que la varianza.
Las auto-covarianzas y auto-correlaciones expuestas anteriormente son los valores poblacionales, estas pueden ser estimadas en una muestra de tamaƱo \(T\) de la siguiente manera: \[\begin{align} \hat{\gamma_j} = & \frac{1}{T} \sum^T_{t=j+1} (x_t - \bar{x}_{j+1:T})(x_{t-j} - \bar{x}_{1:T-j}) \\ \hat{\rho_j} = & \frac{\hat{\gamma_j}}{\widehat{var(x_t)}} \end{align}\]
Vemos un ejemplo de una serie de tiempo con auto-correlación:
El crecimiento del PIB trimestral para EEUU.
Supongamos el siguiente modelo de regresión lineal, \[\begin{equation} y_t = \mathbf{X}_t \boldsymbol{\beta} + u_t, \quad u_t = \rho u_{t-1} + \varepsilon_t, \quad \varepsilon_t \sim IID(0,\sigma^2_{\varepsilon}) \end{equation}\]
es decir, el termino de error \(u_t\) sigue un proceso AR(1).
Como veremos cuando analicemos los modelos Autorregresivos debemos imponer la restricción \(|\rho|<1\).
Sustituyendo \(u_t\) por \(\rho u_{t-1} + \varepsilon_t\),
\[\begin{equation} y_t = \mathbf{X}_t \boldsymbol{\beta} + \rho u_{t-1} + \varepsilon_t \end{equation}\]
Y remplazando \(u_{t-1}\) por \(y_{t-1} - \mathbf{X}_{t-1} \boldsymbol{\beta}\), \[\begin{equation} y_t = \rho y_{t-1} + \mathbf{X}_t \boldsymbol{\beta} - \rho\mathbf{X}_{t-1} \boldsymbol{\beta} + \varepsilon_t \end{equation}\]
Podemos evitar hacer esta estimación no lineal, si hacemos un test basÔndonos en la regresión de Gauss-Newton.
Primero estimamos por MCO la regresión: \[\begin{equation} y_t = \mathbf{X}_t \boldsymbol{\beta} + u_t \end{equation}\]
Sea \(\tilde{u}\) el vector de residuales de la regresión anterior.
Con esto, el test consiste en probar la hipótesis nula de \(b_p = 0\) en la regresión, \[\begin{equation} \tilde{u}_t = b_p \tilde{u}_{t-1} + residuales \end{equation}\] donde \(b_p \sim N(0,1)\) bajo la hipótesis nula.
Yule-Walker Test: Calculamos la autocorrelación de los residuales, \[\begin{equation} \hat{\rho}_1 = \frac{\hat{\gamma}_1}{\hat{\gamma}_0} \end{equation}\] testeamos \(\hat{\rho}_1 = 0\) con \(Var(\hat{\rho}_1) = \frac{1}{T}\).